﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace MvcShop.Models
{
    [MetadataType(typeof(HelperMetadata))]
    public partial class Helper
    {
    }

    public class HelperMetadata
    {
        [Required(ErrorMessage = "帮助类目Id不能为空。")]
        [DisplayName("帮助类目")]
        public int CategoryId { get; set; }

        [Required(ErrorMessage = "帮助标题不能为空。")]
        [StringLength(100, ErrorMessage = "帮助标题不能超过100字节。")]
        [DisplayName("帮助标题")]
        public string HelperName { get; set; }

        [Required(ErrorMessage = "帮助内容不能为空。")]
        [DisplayName("帮助内容")]
        public string HelperContent { get; set; }
    }


    [MetadataType(typeof(HelpCategoryMetadata))]
    public partial class HelpCategory 
    {   
    }

    public class HelpCategoryMetadata
    {
        [Required(ErrorMessage = "帮助类目名称不能为空。")]
        [StringLength(50, ErrorMessage = "帮助类目名称不能超过50字节。")]
        [DisplayName("帮助类目名称")]
        public string CategoryName { get; set; }
    }
}
